import { lazy } from 'ice';
import UserLayout from '@/layouts/UserLayout';
import BasicLayout from '@/layouts/BasicLayout';
import Home from '@/pages/Home';
const Login = lazy(() => import(/* webpackChunkName: 'login' */'@/pages/Login'));
const UserList = lazy(() => import(/* webpackChunkName: 'userList' */'@/pages/UserManager/UserList'));
const UserGroupList = lazy(() => import(/* webpackChunkName: 'UserGroupList' */'@/pages/UserManager/UserGroupList'));
const Coupon = lazy(() => import(/* webpackChunkName: 'Coupon' */'@/pages/Promotion/Coupon'));
const AddCoupon = lazy(() => import(/* webpackChunkName: 'AddCoupon' */'@/pages/Promotion/AddCoupon'));
const Test = lazy(() => import(/* webpackChunkName: 'test' */'@/pages/Test'));
const routerConfig = [
  {
    path: '/user',
    component: UserLayout,
    children: [
      {
        path: '/login',
        component: Login,
      },
      {
        path: '/',
        redirect: '/user/login',
      },
    ],
  },
  {
    path: '/',
    component: BasicLayout,
    children: [
      {
        path: '/userManager/userList',
        component: UserList,
      },
      {
        path: '/userManager/userGroupList',
        component: UserGroupList,
      },
      {
        path: '/promotion/coupon',
        component: Coupon,
      },
      {
        path: '/promotion/addCoupon',
        component: AddCoupon,
      },
      {
        path: '/promotion/test',
        component: Test,
      },
      {
        path: '/',
        component: Home,
      },
    ],
  },
];
export default routerConfig;
